package com.fh.Enum;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by tugou on 2017/9/12.
 */
public enum EnFinalValue {

    /**
     * 性别男
     */
    SEX("SEX",1,"男"),
    /**
     * 性别女
     */
    WOMAN("SEX",2,"女"),
    /**
     * 证件类型：工作证
     */
    EMPCARD("paperType",2,"工作证"),
    /**
     * 证件类型：身份证
     */
    PERSIONCARD("paperType",1,"身份证"),


    LZ("workState",1,"在职"),

    ZZ("workState",2,"保留"),

    BL("workState",3,"保留"),

    SC("workState",4,"删除"),

    /**
     * 补录状态
     */
    BLZT_WQR("BLZT",1,"未确认"),

    BLZT_YQR("BLZT",2,"已确认"),

    BLZT_WXBL("BLZT",3,"无效补录"),

    BLZT_GQ("BLZT",4,"过期"),

    BLZT_YG_WXBL("BLZT",5,"员工确认不补录"),

    /**
     * 补录确认类型
     */
    BLQR_YG("BLQR",1,"员工确认"),

    BLQR_CW("BLQR",2,"财务确认"),

    /**
     * 账户状态-正常
     */
    ZC("saState",1,"正常"),
    /**
     * 账户状态-冻结
     */
    DZ("saState",2,"冻结"),
    /**
     * 账户状态-销户
     */
    CH("saState",3,"销户")
    ;

    public String key;
    public Integer index;
    public String name;

    EnFinalValue(String key,Integer index,String name){
        this.index = index;
        this.name = name;
        this.key = key;
    }

    public static Map<Integer,String> getEnMapByName(String name) {
        Map<Integer, String> map = new HashMap<Integer, String>();
        for (EnFinalValue e : EnFinalValue.values()) {
            if (e.key == name) {
                map.put(e.index,e.name);
            }
        }
        return map;
    }

    public static String getName(String key,Integer index){
        for (EnFinalValue e : EnFinalValue.values()) {
            if(e.key == key){
                if(e.index == index)
                    return e.name;
            }
        }
        return null;
    }
}
